<{include file="public/header.html"}>
<link rel="stylesheet" href="<{$style_dir}>/js/vendor/simditor/font-awesome.css" />
<script type="text/javascript" src="<{$style_dir}>/js/vendor/simditor/simditor.js"></script>
<!--发帖单页面-->
<div class="w1180-con mt20">
    <div class="post-article fl w840">
        <input type="hidden" id="wenda_tid" name="tid" value="<{$task['tid']}>">
        <div class="title">
            <p class="title-big">文章标题</p>
            <div class="title-box">
                <input type="text" <{if $level>=2}>readonly<{/if}> value="<{$task['title']}>" name="articles_title" id="articles_title" placeholder="标题不少于10个字哦" maxlength="70"/>
            </div>
            <i class="mt5"><span class="title-count error">0</span>/50&nbsp;字</i>
        </div>
        <div class="con mt20">
            <p class="title-big">文章内容</p>
            <div class="con-box">
                <textarea id="articles_content" name="articles_content" placeholder="请在这里输入您的文章内容" readonly><{$task['content']}></textarea>
            </div>
            <i class="mt5"><span class="content-count error">0</span>&nbsp;字</i>
        </div>

        <div class="title">
            <p class="title-big">任务数量</p>
            <div class="title-box">
                <input type="text" <{if $level>=1}>readonly<{/if}> name="subnum" id="wenda_subnum" value="" placeholder="" onkeyup="this.value=this.value.replace(/\D/g,'')"/>
            </div>
            <i class="mt5"></i>
        </div>
        <div class="title">
            <p class="title-big">佣金</p>
            <div class="title-box">
                <input type="text"<{if $level>=1}>readonly<{/if}> name="commission" id="wenda_commission" value="<{$task['commission']}>" placeholder="" onkeyup="clearNoNum(this)"/>
            </div>
            <i class="mt5"></i>
        </div>

        <script type="text/javascript">
            $(function() {
                var $preview, editor, mobileToolbar, toolbar;
                Simditor.locale = 'zh-CN';
                toolbar = ['title', 'bold', 'italic', 'underline', 'strikethrough', 'fontScale', 'color', '|', 'blockquote', '|', 'link', 'image', 'hr', '|','alignment'];
                var editor = new Simditor({
                    textarea: $('#articles_content'),
                    toolbar: toolbar,
                    pasteImage: true,
                });
            });
        </script>

        <div class="post-btn mt20">
            <div id="draft_number" data-val="<{$draft_number}>" style="display:none;"></div>
            <input class="release fr ml20 _T_art_publish" type="submit" value="确认修改" data-action-url="<{eval url('task/update')}>" data-unvalid="发布中..."/>
        </div>
    </div>
    <{include file="post/right.html"}>
</div>


<script type="text/javascript">
    $(function(){
        if('<{$login}>' == '1'){
            showLogin('login');return;
        }else{
            if('<{$mobile}>'=='0'){
                layer.msg("发布问答前请到官网个人中心填写手机号!",{icon:0,offset:300,time:2000},function(){window.location.href='/user/security.html#change-phone'});
            }else{
                if("<{$cate_code}>" == "" || "<{$sec_cate_code}>" == "" ){
                    $(".popup-post").fadeIn();
                    $(".popup").fadeIn();
                }
            }
        }
        $('.post-article .label .add-btn').on('click',function(){
            $(this).parents('.label').find('.label-input').toggle(500);
        });
        $('.post-article .tip-mail .checkbox').on('click',function(){
            $(this).hasClass('active') ? $(this).removeClass('active') : $(this).addClass('active');
        });
    });
</script>
<script type="text/javascript" src="<{$style_dir}>/js/post.task2.js"></script>
<script>
    function clearNoNum(obj) {
        obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
        obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字而不是
        obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的
        obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数

    }
 </script>
<!--底部-->
<{include file="public/footer.html"}>